package sharewithus.business.service;

import java.io.Serializable;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

/**
 * Title:UserService
 * Description:
 * @Create_by:Vince Yu
 * @Create_date:2012-5-4
 * @Last_Edit_By:
 * @Edit_Description
 * @version:partynano 1.0
 * 
 */
public interface UserService<T, PK extends Serializable> {
	/**
	 * Title:saveRefererUrl
	 * Description:获取跳转前一页面URL并保存在session中
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-7
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public void saveRefererUrlNN(HttpServletRequest request) throws Exception;
	
	
	/**
	 * Title:getRefererUrl
	 * Description:获取跳转前一页面URL
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-12
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public String getRefererUrlNN(HttpServletRequest request) throws Exception;
	
	
	/**
	 * Title:registeUser
	 * Description:用户注册
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-8
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public void registeUser(
			String email,
			String nickname,
			String password,
			String sex,
			String province,
			String city,
			String county,
			String birthYear,
			String birthMonth,
			String birthDay) throws Exception;
	
	/**
	 * Title:checkUser
	 * Description:根据昵称检查用户是否存在
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-9
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public boolean checkUserNN(
			String nickname,
			HttpServletRequest request) throws Exception;
	
	/**
	 * Title:checkEmail
	 * Description:根据邮箱检查用户是否存在
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-9
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public boolean checkEmailNN(
			String email,
			HttpServletRequest request) throws Exception;
	
	
	/**
	 * Title:checkPassword
	 * Description:登录校验用户密码
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-9
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public boolean checkPassword(
			String userName,
			String password,
			HttpServletRequest request) throws Exception;
	
	/**
	 * Title:userLogout
	 * Description:用户登出操作
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-11
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public void userLogout(
			HttpServletRequest request) throws Exception;
	
	
	/**
	 * Title:updateUserInfo
	 * Description:更新用户基础信息
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-12
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public void updateUserInfo(
			String userId,
			String email,
			String nickname,
			String sex,
			String province,
			String city,
			String county,
			String birthYear,
			String birthMonth,
			String birthDay,
			HttpServletRequest request) throws Exception;
	
	
	/**
	 * Title:uploadUserAvatar
	 * Description:上传头像
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-14
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public Map uploadUserAvatar(
			HttpServletRequest request) throws Exception;
	
	
	/**
	 * Title:saveUserAvatar
	 * Description:保存头像
	 * @Create_by:Vince Yu
	 * @Create_date:2012-5-14
	 * @Last_Edit_By:
	 * @Edit_Description
	 * @Create_Version:ShareWithUs 1.0
	 */
	public void saveUserAvatar(String filePath,
    		int x1,
    		int y1,
    		int x2,
    		int y2,
    		int w,
    		int h,
			HttpServletRequest request) throws Exception;
}
